package third;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import vo.Payment;
import vo.Order;
import vo.Users;
import dao.IOrderDao;
import dao.IUserDao;
import service.IPaymentService;
public class testPayment {
	private ApplicationContext ac;
	private IPaymentService paymentService;
	private IOrderDao orderDao;
	private IUserDao userDao;
	public testPayment(){
		ac=new ClassPathXmlApplicationContext("ApplicationContext.xml");
		paymentService=(IPaymentService) ac.getBean("paymentService");
		orderDao=(IOrderDao) ac.getBean("orderDao");
		userDao=(IUserDao) ac.getBean("userDao");
	}
	public static void main(String[] args){
		testPayment tp=new testPayment();
		Users u=tp.userDao.getUserById(4);
		Order o=tp.orderDao.getOrderById(16);
		o.setIsPayment(1);
		tp.orderDao.setOrder(o);
		System.out.print(o.getIsPayment());
		Payment p=new Payment();
		p.setOrder(o);
		p.setPaymentNo("00");
		p.setUsers(u);
		//tp.paymentService.addPayment(p);
		
	}
}
